﻿Public Class SettingsForm
    Private AUDIO_FILE As String
    Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
        settings.Hours = Convert.ToInt32(HoursUpDown.Value)
        settings.Minutes = Convert.ToInt32(MinutesUpDown.Value)
        settings.Seconds = Convert.ToInt32(SecondsUpDown.Value)
        settings.SnoozeMinutes = Convert.ToInt32(SnoozeUpDown1.Value)
        settings.Sync()
    End Sub

    Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
        Close()
    End Sub

    Private Sub cmdBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdBrowse.Click
        GetFilePath()
    End Sub
    Private Sub GetFilePath()
        Dim path As String = ""
        Dim ofd As New OpenFileDialog()
        ofd.Filter = "Sound Files(*.mp3,*.wav,*.wma)|*.mp3;*.wav;*.wma"
        ofd.FilterIndex = 1
        If ofd.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
            path = System.IO.Path.GetFullPath(ofd.FileName)
        End If
        AUDIO_FILE = path
        settings.alarmsound = AUDIO_FILE
    End Sub

End Class